package com.ruoyi.neo.domain;

import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.data.neo4j.core.schema.GeneratedValue;
import org.springframework.data.neo4j.core.schema.Id;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Relationship;

import java.util.List;

/**
 * 零件分类对象 part_category
 * 
 * @author ruoyi
 * @date 2025-03-09
 */
@Data
@Node(labels = "PartCategory")
public class PartCategory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 分类编号 */
    @Id
    @GeneratedValue
    private Long id;
    private Long categoryId;

    /** 分类名称 */
    @Excel(name = "分类名称")
    private String categoryName;

    /** 父分类编号 */
    @Excel(name = "父分类编号")
    private Long parentCategoryId;

    /** 分类描述 */
    @Excel(name = "分类描述")
    private String description;

    @Relationship(type = "BELONG TO", direction = Relationship.Direction.INCOMING)
    private List<Part> parts;

    public void setCategoryId(Long categoryId) 
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId() 
    {
        return categoryId;
    }
    public void setCategoryName(String categoryName) 
    {
        this.categoryName = categoryName;
    }

    public String getCategoryName() 
    {
        return categoryName;
    }
    public void setParentCategoryId(Long parentCategoryId) 
    {
        this.parentCategoryId = parentCategoryId;
    }

    public Long getParentCategoryId() 
    {
        return parentCategoryId;
    }
    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("categoryId", getCategoryId())
            .append("categoryName", getCategoryName())
            .append("parentCategoryId", getParentCategoryId())
            .append("description", getDescription())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
